import request from '@/utils/request'

// 查询sql执行工具列表
export function listSqltool(query) {
  return request({
    url: '/operation/sqltool/list',
    method: 'get',
    params: query
  })
}

// 查询sql执行工具详细
export function getSqltool(id) {
  return request({
    url: '/operation/sqltool/' + id,
    method: 'get'
  })
}

// 新增sql执行工具
export function addSqltool(data) {
  return request({
    url: '/operation/sqltool',
    method: 'post',
    data: data
  })
}

// 修改sql执行工具
export function updateSqltool(data) {
  return request({
    url: '/operation/sqltool',
    method: 'put',
    data: data
  })
}

// 删除sql执行工具
export function delSqltool(id) {
  return request({
    url: '/operation/sqltool/' + id,
    method: 'delete'
  })
}

export function executeSql(name){
  return request({
    url: '/operation/sqltool/execute/sql'+'?name='+name,
    method: 'get',
  })
}

export function getSysList(){
  return request({
    url:'/operation/busisystem/list',
    method:'get',
  })
}

export function getRmoteDBUrl(dbType){
  return request({
    url:`operation/sqltool/remote/dburl?dbType=${dbType}`,
    method:'get',
  })
}
